<template>
  <!-- 用户抗位置泄露-大屏 -->
  <el-container ref="bigModel" class="main-model">
    <el-header>
      <Header :active-title="2" />
    </el-header>
    <el-main>
      <div class="home-model">
        <el-row style="height: 100%">
          <el-col :span="24" style="height: 100%">
            <div class="home-model-left">
              <div>
                <map1 />
              </div>
            </div>
          </el-col>
        </el-row>
        <div class="rightModel" :style="{ width: rightModelShow ? '20%' : '1px' }">
          <img v-if="rightModelShow" :src="require('@/assets/xd/new/Group 1142813242.png')" alt="" class="rightJ"
            style="" @click="hideRightModel">
          <img v-else :src="require('@/assets/xd/new/Group 1142813263.png')" alt="" class="rightJ" style=""
            @click="showRightModel">
          <div class="home-model-right">
            <div class="infoModel">
              <div class="infoTitle flex-container">
                用户位置泄露风险统计
                <!-- 跳转终端页面 -->
                <el-button type="text" @click="toantiLocalization" class="more">
                  更多
                </el-button>
              </div>
              <div class="infoContent" :style="{ height: infoHeight + 'px' }">
                <pie />
              </div>
            </div>
            <div class="infoModel">
              <div class="infoTitle flex-container">
                设备位置泄露风险告警
                <!-- 跳转终端页面 -->
                <el-button type="text" @click="toantiLocalization" class="more">
                  更多
                </el-button>
              </div>
              <div class="infoContent" :style="{ height: infoHeight + 'px' }">
                <list-scroll class="box" :speed="0.5">
                  <div class="list">
                    <div class="infoItem1" v-for="(item, index) in infoList" :key="index"
                      @click="toantiLocalizationdetail">
                      <div class="_num">
                        {{ index + 1 }}
                      </div>
                      <div class="_cont">
                        {{ item.content }}
                      </div>
                    </div>
                  </div>
                </list-scroll>
              </div>
            </div>

            <div class="infoModel">
              <div class="infoTitle flex-container">
                设备抗定位任务列表
                <el-button type="text" @click="toantiLocalization" class="more">
                  更多
                </el-button>
              </div>
              <div class="infoContent" :style="{ height: infoHeight + 'px' }">
                <list-scroll class="box" :speed="0.5">
                  <div class="list">
                    <div class="infoItem2" v-for="(item, index) in infoList2" :key="index">
                      <div class="_num">
                        {{ index + 1 }}
                      </div>
                      <div class="_cont">
                        {{ item.content }}
                      </div>
                    </div>
                  </div>
                </list-scroll>
              </div>
            </div>
          </div>
        </div>
      </div>
    </el-main>
  </el-container>
</template>

<script>
import Header from "@/views/xd/components/Header";
import pie from "@/views/xd/components/charts/new/home5.vue";
import ListScroll from "@/components/DtSrcollCopy2";
import map1 from "@/views/xd/components/charts/map.vue";

export default {
  components: { Header, pie, ListScroll, map1 },
  data() {
    return {
      rightModelShow: true,
      rightModelSpan: 7,
      leftModelSpan: 17,
      activeIndex: "1",
      activeIndex2: "1",
      formInline: {
        user: "",
        region: "",
      },
      infoList: [
        {
          content: "461单位，202.196.0.37，风险距离为3KM",
        },
        {
          content: "552单位，202.196.0.45，风险距离为3KM",
        },
        {
          content: " 832单位，202.196.0.62，风险距离为3KM",
        },
        {
          content: "741单位，202.196.0.65，风险距离为3KM",
        },
        {
          content: "156单位，202.196.0.35，风险距离为7KM",
        },
        {
          content: "552单位，202.196.0.45，风险距离为3KM",
        },
        {
          content: "741单位，202.196.0.65，风险距离为3KM",
        },
        {
          content: "156单位，202.196.0.35，风险距离为7KM",
        },
        {
          content: "552单位，202.196.0.45，风险距离为3KM",
        },


      ],
      infoList2: [
        {
          content: "202.196.0.48 位置保护任务已执行完成",
        },
        {
          content: "202.196.0.45 位置保护任务已完成70%",
        },
        {
          content: "202.196.0.42 位置保护任务已完成60%",
        },
        {
          content: "202.196.0.96 位置保护任务已完成50%",
        },
        {
          content: "202.196.0.47 位置保护任务已完成40%",
        },
        {
          content: "202.196.0.12 位置保护任务已完成30%",
        },
        {
          content: "202.196.0.42 位置保护任务已完成60%",
        },
        {
          content: "202.196.0.96 位置保护任务已完成50%",
        },
        {
          content: "202.196.0.47 位置保护任务已完成40%",
        },
        {
          content: "202.196.0.12 位置保护任务已完成30%",
        },
        {
          content: "202.196.0.42 位置保护任务已完成60%",
        },
        {
          content: "202.196.0.96 位置保护任务已完成50%",
        },
        {
          content: "202.196.0.47 位置保护任务已完成40%",
        },

      ],
      map: "",
      infoHeight: 300,
    };
  },
  mounted() {
    this.infoHeight = (this.$refs.bigModel.$el.offsetHeight - 80) / 3;
    let that = this;
  },

  methods: {

    toantiLocalization() {
      this.$router.push("/networkUser/antiLocalization");
    },

    toantiLocalizationdetail() {
      this.$router.push("/networkScreendetails");
    },

    hideRightModel() {
      this.rightModelShow = false;
      this.rightModelSpan = 0;
      this.leftModelSpan = 24;
    },
    showRightModel() {
      this.rightModelShow = true;
      this.rightModelSpan = 5;
      this.leftModelSpan = 19;
    },


    onSubmit() { },
  },
};
</script>
<style lang="scss" scoped>
.el-header {
  padding: 0;
  z-index: 5;
}

.mapModel {
  width: 100%;
  height: 100%;
}

.home-model-right {

  border-radius: 5px;
  padding: 5px;
}

.home-model-left {
  position: relative;
  height: 100%;
}

.home-model {
  position: relative;
  width: 100%;
  height: 100%;
}

.home-model-search {
  z-index: 100000;
}

.home-model-right {
  .infoModel {
    position: relative;

    .infoTitle {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      background-image: url(~@/assets/xd/new/title.png);
      background-repeat: no-repeat;
      background-size: 100% 80%;
      color: #fff;
    }

    .infoBody {
      height: 100%;
      padding-top: 40px;
      box-sizing: border-box;
    }
  }
}

.rightModel {
  position: absolute;
  right: 0;
  top: 0;
  width: 20%;
  height: 100%;
}

.rightJ {
  left: -50px;
}

.flex-container {
  display: flex;
  justify-content: space-between;
}

.btn {
  position: absolute;
  right: 20%;
  z-index: 999;
  font-size: 20px;
}

.main-model {
  background-image: url(~@/assets/xd/new/homebg.png);
  background-color: #094294;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.more {
  color: #fff;
  font-size: 22px;
  font-weight: bold;
}
</style>
